<template>
  <div class="outdent_div">
    <img v-if="type == 0" src="../../assets/outdent.png" class="div_img" @click="hideOrShowHandler"/>
    <img v-if="type == 1" src="../../assets/indent.png" class="div_img" @click="hideOrShowHandler"/>
  </div>
</template>

<script>
export default {
  data() {
    return {
      type: 0
    };
  },
  mounted() {
    // this.loadCompany();
  },
  beforeDestroy() {},
  methods: {
    // 折叠或者展开左侧菜单栏
    hideOrShowHandler() {
      var collapse = false;

      if (this.$store.state.isCollapse == true) {
        collapse = false;
        this.type = 0;
      } else {
        collapse = true;
        this.type = 1;
      }
      this.$store.commit("changeState", collapse);
    }
  }
};
</script>

<style lang="scss" scoped>
.outdent_div {
  width: 60px;
  height: 60px;

  .div_img {
    width: 20px;
    height: 20px;
    margin-left: 20px;
    margin-top: 20px;
  }
}
.outdent_div:hover {
  background-color: lightgray;
}
.outdent_div:active {
  background-color: lavenderblush;
}
</style>
